<template>
  <div>
    <van-nav-bar
      title="注册"
      left-text="返回"
      right-text="登录"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="用户名"
        label="用户名"
        placeholder="请输入用户名"
        :rules="[{ required: true}]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="请输入密码"
        :rules="[{ required: true}]"
      />
      <van-field
        v-model="repassword"
        type="password"
        name="请确认密码"
        label="确认密码"
        placeholder="请输入确认密码"
        :rules="[{ required: true}]"
      />
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit">注册</van-button>
      </div>
    </van-form>
  </div>
</template>
<script>
export default {
  name: "Regist",
  data(){
    return {
      username:"",
      password:"",
      repassword:""
    }
  },
  methods:{
    onClickLeft(){
      window.history.go(-1);
    },
    onClickRight(){
      this.$router.push("/login");
    },
    onSubmit(){
      alert("提交");

    }

  }

};
</script>
<style scoped>
</style>